<!-- 导航URL -->
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-md-12">
		<ol class="breadcrumb">
			<li><a>主页</a></li>
			<li><a>商户管理</a></li>
			<li class="active"><strong>查询商户</strong></li>
		</ol>
	</div>
</div>
<!-- 主要内容 -->
<div class="wrapper wrapper-content animated fadeIn" ng-app
	 ng-controller="merchantQueryCtrl">
	<form class="form-horizontal" id="form1" name="horizontal">
		<div class="row">
			<div class="col-lg-12">
				<div class="">
					<div class="panel-body ibox float-e-margins">
						<div class="ibox-title">
							<h5>商户信息多条列表查询</h5>
						</div>
						<div class="ibox-content">
							<div class="form-group">
								<label class="col-sm-2 control-label">商户进件编号：</label>
								<div class="col-sm-2">
									<input type="text" class="form-control" ng-model="info.mbpId">
								</div>
								<label class="col-sm-2 control-label">商户名称/编号：</label>
								<div class="col-sm-2">
									<input type="text" class="form-control" ng-model="info.merchantNo" onchange="keyChange()">
									<!-- <select name="autocomplete-select" id="autocomplete-select1" onchange="keyChange()"
											ng-model="info.merchantNo" ng-options="x.value as x.text for x in merchantSelect"
											style="width: 100%" chosen chosen-data="merchantSelect" chosen-keyup="getMerchantSelect">
									</select> -->
								</div>
								<label class="col-sm-2 control-label">商户手机号：</label>
								<div class="col-sm-2">
									<input type="text" class="form-control" ng-model="info.mobilephone" onchange="keyChange()">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">商户冻结状态：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model="info.riskStatus"
											ng-options="x.value as x.text for x in riskStatusaa"/>
								</div>
								<label class="col-sm-2 control-label">业务产品状态：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model="info.merchantExamineState"
											ng-options="x.value as x.text for x in merchantStates"/>
								</div>
								<label class="col-sm-2 control-label">商户状态：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model="info.merStatus"
											ng-options="x.value as x.text for x in merStatusList"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">代理商名称：</label>
								<div class="col-sm-2">
									<select name="autocomplete-select" id="autocomplete-select"
											ng-model="info.agentName" ng-options="x.value as x.text for x in agent"
											style="width: 100%" chosen chosen-data="agent" chosen-keyup="getStates">
									</select>
								</div>
								<label class="col-sm-2 control-label">包含下级：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model="info.agentNode"
											ng-options="x.value as x.text for x in IsYN"/>
								</div>
								<label class="col-sm-2 control-label">业务产品：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model="info.productType"
											ng-options="x.bpId as x.bpName for x in productTypes"/>
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-2 control-label">鉴权通道：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model="info.authChannel"
													ng-options="x.value as x.text for x in authChannels">
										<option>全部</option>
									</select>
								</div>
								<label class="col-sm-2 control-label">自动审核活体通道：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model="info.autoMbpChannel"
													ng-options="x.value as x.text for x in huoTiChannels">
									<option>全部</option>
									</select>
								</div>
								<label class="col-sm-2 control-label">代理商推广:</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model='info.sourceSysSta' ng-options="x.value as x.text for x in sourceSysStaSelect">
									</select>
								</div>
							</div>


							<div class="form-group">
								<label class="col-sm-2 control-label">硬件产品种类：</label>
								<div class="col-sm-2">
									<select class="form-control" ng-model="info.termianlType"
											ng-options="x.hpId as x.typeName for x in termianlTypes"/>
									<span class="req_mesg">(此属性暂未生效)</span>
								</div>
								<label class="col-sm-2 control-label">创建时间：</label>
								<div class="col-sm-6">
									<input id="d5221" class="form-control" type="datetime" ng-model="info.sTime"
										   onchange="" style="width:auto;display:inline-block;"
										   onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',changed:verifyTime(1,'#d5221','#d5222',31,isVerifyTime),onpicked:function(){d5222.focus();},maxDate:'#F{$dp.$D(\'d5222\')||\'%y-%M-%d\'}'})"/>
									~
									<input id="d5222" class="form-control" type="datetime" ng-model="info.eTime"
										   onchange="" style="width:auto;display:inline-block;"
										   onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',changed:verifyTime(2,'#d5221','#d5222',31,isVerifyTime),minDate:'#F{$dp.$D(\'d5221\')}',maxDate:'%y-%M-%d 23:59:59'})"/>
									<br/><span><font color="#999">备注：查询范围不能超过一个月</font></span>
								</div>
							</div>
							<div ng-show="visible">
								<div class="form-group">
									<label class="col-sm-2 control-label">身份证号码：</label>
									<div class="col-sm-2">
										<input type="text" class="form-control" ng-model="info.cardId" onchange="keyChange()">
									</div>
									<label class="col-sm-2 control-label">开户名：</label>
									<div class="col-sm-2">
										<input type="text" class="form-control" ng-model="info.accountName" onchange="keyChange()">
									</div>
									<label class="col-sm-2 control-label">开户账号：</label>
									<div class="col-sm-2">
										<input type="text" class="form-control" ng-model="info.accountNo">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">是否开户：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.merAccount"
												ng-options="x.value as x.text for x in merAccounts"/>
									</div>
									<label class="col-sm-2 control-label">收单机构商户编号：</label>
									<div class="col-sm-2">
										<input type="text" class="form-control" ng-model="info.acqOrgMerNo">
									</div>
									<label class="col-sm-2 control-label">自动审核结论：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.openStatus"
												ng-options="x.value as x.text for x in openStatuss"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">是否经过自动审核：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.autoCheckTimes"
												ng-options="x.value as x.text for x in merAccounts"/>
									</div>
									<label class="col-sm-2 control-label">预冻结金额：</label>
									<div class="col-sm-5">
										<input type="text" ng-model="info.preFrozenMoney1" class="form-control"
											   style="width:auto;display:inline-block;"> ~
										<input type="text" ng-model="info.preFrozenMoney2" class="form-control"
											   style="width:auto;display:inline-block;">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">是否参加欢乐送：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.activityType"
												ng-options="x.value as x.text for x in activityTypes"/>
									</div>
									<label class="col-sm-2 control-label">推广来源：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.recommendedSource"
												ng-options="x.value as x.text for x in recommendedSources"/>
									</div>

									<label class="col-sm-2 control-label">交易模式：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.tradeType"
												ng-options="x.value as x.text for x in tradeType" ng-change="changeTradeType()"/>
									</div>

								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">所属组织：</label>
									<div class="col-sm-2">
										<select class="form-control"  ng-model='info.teamId' ng-change="hasSubTeam(info.teamId)"
												ng-options="x.value as x.text for x in team">
										</select>
									</div>
									<label class="col-sm-2 control-label">所属子组织：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model='info.teamEntryId'
												ng-options="x.value as x.text for x in subTeams">
											<option value="">全部</option>
										</select>
									</div>
									<label class="col-sm-2 control-label" id="syncLabel" style="display: none">直清同步状态：</label>
									<div class="col-sm-2" id="syncDiv" style="display: none">
										<select class="form-control" ng-model="info.syncStatus"
												ng-options="x.value as x.text for x in syncStatus"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">所属省市：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.province"
												ng-options="x.value as x.text for x in provinceList" ng-change="changeProvince()"/>
									</div>
									<div ng-show="cityShow">
										<div class="col-sm-2"  >
											<select class="form-control" ng-model="info.city"
													ng-options="x.value as x.text for x in cityList"/>
										</div>
									</div>
									<label class="col-sm-2 control-label">进件来源:</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.itemSource"
												ng-options="x.value as x.text for x in itemSourceSelect"/>
									</div>
									<label class="col-sm-2 control-label">商户类型:</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.merchantType"
												ng-options="x.value as x.text for x in merchantTypeLists"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">是否特约商户：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.specialMerchant" ng-options="x.value as x.text for x in specials"/>
									</div>
									<label class="col-sm-2 control-label">特约商户编号：</label>
									<div class="col-sm-2">
										<input type="text" class="form-control" ng-model="info.acqMerchantNo">
									</div>
									<label class="col-sm-2 control-label">特约商户名称：</label>
									<div class="col-sm-2">
										<input type="text" class="form-control" ng-model="info.acqMerchantName">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">特约商户绑定时间:</label>
									<div class="col-sm-6">
										<input id="d5231" class="form-control" type="datetime" ng-model="info.bindTimeBegin" onchange=""  style="width:auto;display:inline-block;"
											   onFocus="var d5232=$dp.$('d5232');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5232.focus();},maxDate:'#F{$dp.$D(\'d5232\')}'})"/>
										~
										<input id="d5232" class="form-control" type="datetime"  ng-model="info.bindTimeEnd" onchange=""  style="width:auto;display:inline-block;"
											   onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5231\')}'})"/>
									</div>
									<label class="col-sm-2 control-label">默认购买资金损失险：</label>
									<div class="col-sm-2">
										<select class="form-control" ng-model="info.everyTimes"
												ng-options="x.value as x.text for x in boolAll"/>
									</div>
								</div>

							</div>
							<div class="more-term"  style="text-align:right;margin-bottom:20px;padding-right: 39px;color:#3baaff;"><span ng-click="toggle()" style="cursor:pointer;" ng-class="{true:'active',false:''}[visible]">{{mtxt}}</span></div>
							<div class="form-group">
								<div class="col-lg-12">
									<div class="col-sm-2"></div>
									<button class="btn btn-primary6 btn-mr20" type="button"
											ng-click="selectInfo()" >查询
									</button>
									<button class="btn btn-primary3 btn-mr20" type="button"
											ng-click="clear()" >清空
									</button>
									<button class="btn btn-new" type="button"
											ng-show="hasPermit('merchant.openAccountBatch')"
											ng-click="createAccountInfo()" style="width: 120px" id="btnSubmit">批量开户
									</button>
								</div>

							</div>
						</div>
					</div>


					<div class="panel-body ibox float-e-margins">
						<div class="ibox-title">
							<h5>商户信息列表</h5>
							<div class="ibox-content">
                                <div class="tposition">
                                    <div ui-grid="gridOptions" ui-grid-resize-columns ui-grid-pagination ui-grid-selection
                                         ui-grid-pinning class="grid"></div>
                                    <div ng-show="loadImg" class="timg"></div>
                                </div>
							</div>
						</div>
					</div>
					<div style="height: 30px; clear: both"></div>
				</div>
			</div>
		</div>
	</form>

	<!-- 模态框（Modal）修改状态 -->
	<div id="upRiskStatus" class="modal fade" tabindex="-1" role="dialog">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						&times;
					</button>
					<h3 class="modal-title">修改商户冻结状态</h3>
				</div>
				<div class="modal-body">
					<form id="form2">
						<div class="form-group">
							<label class="col-sm-2 control-label">商户冻结状态：</label>

							<div class="col-sm-3">
								<select class="form-control" ng-model="merRiskStatus"
										ng-options="x.value as x.text for x in riskStatusa1"/>
							</div>
							<input type="hidden" class="form-control" ng-model="merId">
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" ng-click="upRiskStatusCommit()" ng-disabled="submitting"
							class="btn btn-primary btn-mr20">确定
					</button>
					<button type="button" ng-click="upRiskStatusColse()" ng-disabled="submitting"
							class="btn btn-primary11">关闭
					</button>
				</div>
			</div>
		</div>
	</div>

	<!-- 预冻结 -->
	<div id="preFrozenModal" class="modal fade" tabindex="2" role="dialog">
		<div class="modal-dialog" style="height:350px;width: 700px">
			<div class="modal-content" style="height:350px;width: 700px">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						&times;</button>
					<h3 class="modal-title">预冻结</h3>
				</div>
				<div class="modal-body">
					<div id="preFrozenMsg"><span style="color:red;padding-bottom:10px;">提醒：</span><span>该商户存在未被冻结的余额，请谨慎操作预冻结！</span>
					</div>
					<div class="form-group control-label" style="overflow:hidden; padding-bottom:20px;">
						<label class="col-sm-3 control-label">商户号：</label>

						<div class="col-sm-5">
							<input type="text" class="form-control" disabled="true" 　readOnly="true"
								   ng-model='preFrozen.preFrozenMerchant'>
						</div>
					</div>
					<div class="form-group control-label" style="overflow:hidden; padding-bottom:20px;">
						<label class="col-sm-3 control-label"><i class="red_req">*</i>预冻结金额：</label>

						<div class="col-sm-5">
							<input type="text" class="form-control" ng-blur="overFormat()"
								   ng-model='preFrozen.preFrozenMoney' required/>
						</div>
					</div>
					<div class="form-group control-label" style="overflow:hidden; padding-bottom:0px;">
						<label class="col-sm-3 control-label">备注：</label>

						<div class="col-sm-8">
							<input type="text" class="form-control" name="preFrozenNote"
								   ng-model='preFrozen.preFrozenNote' ng-maxlength="50">
						</div>

					</div>
					<div class="form-group control-label" style="overflow:hidden; padding-bottom:0px;">
						<label class="col-sm-3 control-label"></label>

						<div class="col-sm-8">
							<div style="text-align:left" class="req_mesg"
								 ng-show="horizontal.preFrozenNote.$dirty &&  horizontal.preFrozenNote.$invalid || horizontal.preFrozenNote.$error.maxlength">
								备注限制为50位汉字,字母,空格,或者数字
							</div>
						</div>
					</div>
					<div class="form-group control-label">
						<label class="col-sm-2 control-label"></label>

						<div class="col-sm-6">
							<button class="btn btn-primary btn-mr20"
									ng-disabled="horizontal.$invalid || existFlag || submitting " type="button"
									ng-click='savePreFrozen()'>预冻结
							</button>
							<button class="btn btn-primary4" type="button" ng-click='cancel()'>取消</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

    <!-- 模态框（Modal）商户绑定信用卡 -->
    <div id="bindCreditCardModal" class="modal fade" tabindex="-2" role="dialog">
        <div class="modal-dialog" style="width: 900px">
            <div class="modal-content" style="width: 900px">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        &times;
                    </button>
                    <h3 class="modal-title">商户绑定信用卡</h3>
                </div>
                <div class="modal-body">
                    <form id="form3">
                        <div class="form-group">
                            <div ui-grid="creditcardGrid" class="grid gridStyle" style="width:100%" ui-grid-resize-columns ui-grid-auto-resize></div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" ng-click="cancel()" class="btn btn-primary11">关闭</button>
                </div>
            </div>
        </div>
    </div>

	<!-- 模态框（Modal）更换业务产品 -->
	<div id="replaceBusinessProductModal" class="modal fade" tabindex="-2" role="dialog">
		<form class="form-horizontal" id="replaceBusinessProductModalForm" name="horizontalReplaceBusinessProduct">
			<div class="modal-dialog" style="width: 900px">
				<div class="modal-content" style="width: 900px">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							&times;
						</button>
						<h3 class="modal-title">更换业务产品</h3>
					</div>
					<div class="modal-body">
						<form id="form4">
							<div class="form-group">
								<label class="col-sm-2 control-label">商户号：</label>
								<div class="col-sm-4 lh30" ng-bind="replaceInfo.merchantNo"></div>
								<label class="col-sm-2 control-label">商户名称：</label>
								<div class="col-sm-4 lh30" ng-bind="replaceInfo.merchantName"></div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">业务产品名称：</label>
								<div class="col-sm-4 lh30" ng-bind="replaceInfo.bpName"></div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">请选择更改后的业务产品：</label>
								<div class="col-sm-4">
									<select class="form-control " name="newBpId" ng-model="replaceInfo.newBpId" ng-options="x.bpId as x.bpName for x in replaceBpList" required>
										<option value="" disabled selected>请选择</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">备注：</label>
								<div class="col-sm-8">
									<textarea class="form-control" ng-model="replaceInfo.remark" rows="5" cols="20" maxlength="200"></textarea>
								</div>
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<button class="btn btn-primary btn-mr20"
								ng-disabled="horizontalReplaceBusinessProduct.$invalid || replaceBusinessProductSubmitStatus "
								ng-click='replaceBusinessProductSubmit()'>提交
						</button>
						<button type="button" ng-click="cancel()" class="btn btn-primary11">关闭</button>
					</div>
				</div>
			</div>
		</form>
	</div>

</div>


